﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Bymed.SpineScan.WPF.Shared;
using Bymed.SpineScan.WPF.ViewModel;
using Bymed.SpineScan.WPF.ViewModel.TestItemViewModel;
using GalaSoft.MvvmLight.Messaging;

namespace Bymed.SpineScan.WPF
{
    /// <summary>
    /// Interaction logic for SingleTestDetailWindow.xaml
    /// </summary>
    public partial class SingleTestDetailWindow : WindowBase
    {
        public SingleTestDetailWindow()
        {
            InitializeComponent();
        }

        private void ButtonPrint_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var historyDataAnalysisWindow = new HistoryDataAnalysisWindow();
                var historyDataAnalysisViewModel = historyDataAnalysisWindow.DataContext as HistoryDataAnalysisViewModel;
                historyDataAnalysisViewModel.PatientBasicInfoDisplayViewModel = ((SingleTestDetailViewModel)DataContext).PatientBasicInfoDisplayViewModel;
                historyDataAnalysisViewModel.LoadHistoryData(((SingleTestDetailViewModel)DataContext).SelectedTestItem);
                historyDataAnalysisViewModel.ResetProperties();

                historyDataAnalysisWindow.ShowDialog();
            }
            catch (Exception ex)
            {
                MyViewModelBase.RequestDisplayErrorMessage(ex.Message);
            }
        }

        private void ButtonClose_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}
